<php> D('Home/Member')->need_login();</php>

<!--[if lt IE 8]>
<div class="alert alert-danger" style="margin-bottom: 0">您正在使用 <strong>过时的</strong> 浏览器. 是时候 <a target="_blank" href="http://browsehappy.com/">更换一个更好的浏览器</a> 来提升用户体验.</div>
<![endif]-->



<div id="logo_bar" class="logo_bar">
    <div class="container clearfix">
        <div class="row logo">
            <div class="col-xs-7 col-md-2">
                <a href="{:U('Home/Index/index')}"><img src="__PUBLIC__/Core/images/logo.png"/></a>
            </div>

            <div class=" col-xs-12 header_nav_right col-md-3 pull-right">
                <php>
                    if(is_login()){
                    $unreadSystemMessage=D('Common/Message')->getHaventReadSystemMeassageAndToasted(is_login());
                    $unreadAskHelpMessage=D('Common/Message')->getHaventReadAskForHelpMeassageAndToasted(is_login());
                    $unreadFollowMessage=D('Common/Message')->getHaventReadFollowMeassageAndToasted(is_login());
                    $unreadTalkMessage=D('Common/Message')->getHaventReadTalkMeassageAndToasted(is_login());
                    if(count($unreadFollowMessage)||count($unreadAskHelpMessage)||count($unreadTalkMessage)||count($unreadSystemMessage)){
                </php>
                    <ul class="" style="position: absolute;top: 100%;right: 5px;z-index: 800;float: right;max-width: 140px;padding: 5px;margin: 2px 0 0;list-style: none;font-size: 14px;background-color: #ffffff;border: 1px solid #e5e5e5;border-radius: 0px;background-clip: padding-box;">
                        <if condition="count($unreadFollowMessage) neq 0"><li style="line-height: 20px;float: right"><a href="{:U('Usercenter/Message/message',array('tab'=>'follow'))}">收到<span style="color: #f36119"> {:count($unreadFollowMessage)} </span>条膜拜</a></li></if>
                        <if condition="count($unreadAskHelpMessage) neq 0"><li style="line-height: 20px;float: right"><a href="{:U('Usercenter/Message/message',array('tab'=>'help'))}">收到<span style="color: #f36119"> {:count($unreadAskHelpMessage)} </span>条求帮忙</a> </li></if>
                        <if condition="count($unreadTalkMessage) neq 0"><li style="line-height: 20px;float: right"><a href="{:U('Usercenter/Message/message',array('tab'=>'talk'))}">收到<span style="color: #f36119"> {:count($unreadTalkMessage)} </span>条悄悄话</a> </li></if>
                        <if condition="count($unreadSystemMessage) neq 0"><li style="line-height: 20px;float: right"><a href="{:U('Usercenter/Message/message',array('tab'=>'system'))}">收到<span style="color: #f36119"> {:count($unreadSystemMessage)} </span>条系统消息</a> </li></if>
                    </ul>
                    <php>}}</php>
                <ul class="pull-right" style="margin-bottom: 0;">
                    <if condition="is_login()">

                        <li class="dropdown header_right_click">
                            <php>
                                $common_header_user = query_user(array('nickname'));
                            </php>
                            <a role="button" class="dropdown-toggle dropdown-toggle-avatar " data-toggle="dropdown">
                                {$common_header_user.nickname}&nbsp;<i style="font-size: 12px"
                                                                       class="glyphicon glyphicon-chevron-down"></i>
                            </a>
                            <ul class="dropdown-menu text-left" role="menu" style="max-width: 100px;left: auto;right: 0;">
                                <li style="width: 100%"><a href="{:U('Usercenter/Index/index')}">主页</a>
                                </li>
                                <li style="width: 100%"><a href="{:U('usercenter/message/chat')}">通知</a>
                                </li>
                                <li style="width: 100%"><a href="{:U('Usercenter/Config/info')}">设置</a>
                                </li>
                                <if condition="is_administrator()">
                                    <li style="width: 100%"><a href="{:U('Admin/Index/index')}" target="_blank">管理</a></li>
                                </if>
                                <li style="width: 100%"><a event-node="logout">退出</a>
                                </li>
                            </ul>
                        </li>



                        <else/>
                        <li class="" >
                            <a href="#quicklogin" class="quick_login_link">微博登录</a>
                        </li>
                        <!--<li class="" style="margin-left: 10px;">
                            <a href="{:U('Home/User/login')}">登录</a>
                        </li>-->
                        <li class="" style="margin-left: 10px;">
                            <a href="#quicklogin" class="quick_login_link">注册</a>
                        </li>
                    </if>


                </ul>

            </div>



            <div class="container  sub_menu col-xs-12 col-md-7">
                <nav class="navbar navbar-default" role="navigation">
                    <!-- We use the fluid option here to avoid overriding the fixed width of a normal container within the narrow content columns. -->
                    <div class="container-fluid">
                        <div class="navbar-header">
                            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse"
                                    data-target="#bs-example-navbar-collapse-7">
                                <span class="sr-only">打开导航</span>
                                <span class="icon-bar"></span>
                                <span class="icon-bar"></span>
                                <span class="icon-bar"></span>
                            </button>
                            <a class="navbar-brand">{$brand}</a>
                        </div>

                        <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-7">
                            <ul class="nav navbar-nav">

                                <php>if(is_login()){</php>
                                <li class="<eq name='MODULE_NAME' value='Home'>active<else/></eq>">
                                    <a href="{:U('home/index/index')}" target="_blank">首页 </a>
                                </li>
                                <php>}</php>


                                <think:nav name="nav">
                                    <eq name="nav.pid" value="0">
                                        <php>
                                            $children=D('Channel')->where(array('pid'=>$nav['id']))->order('sort asc')->select();
                                            if($children){
                                        </php>
                                        <li class="dropdown">
                                            <a class="dropdown-toggle nav_item" data-toggle="dropdown" href="#" style="color:{$nav.color}">

                                                {$nav.title} <span class="caret"></span><neq name="nav.band_text" value="" > <span class="badge" style="background: {$nav.band_color}">{$nav.band_text}</span></neq>
                                            </a>
                                            <ul class="dropdown-menu">
                                                <volist name="children" id="subnav">
                                                    <li role="presentation"><a role="menuitem" tabindex="-1" style="color:{$subnav.color}"
                                                                               href="{$subnav.url|get_nav_url}"
                                                                               target="<eq name='subnav.target' value='1'>_blank<else/>_self</eq>">{$subnav.title}<neq name="subnav.band_text" value="" >  <span class="badge" style="background: {$subnav.band_color}">{$subnav.band_text}</span></neq></a>
                                                    </li>
                                                </volist>
                                            </ul>
                                        </li>
                                        <php>}else{</php>
                                        <li class="<eq name='nav.url|get_nav_active' value='1'>active<else/></eq>">
                                            <a href="{$nav.url|get_nav_url}"
                                               target="<eq name='nav.target' value='1'>_blank<else/>_self</eq>" style="color:{$nav.color}">{$nav.title}<neq name="nav.band_text" value="" >  <span class="badge" style="background: {$nav.band_color}">{$nav.band_text}</span></neq></a>
                                        </li>
                                        <php>}</php>
                                    </eq>
                                </think:nav>
                            </ul>
                        </div>
                        <!-- /.navbar-collapse -->
                    </div>
                </nav>
            </div>


        </div>
    </div>
</div>


<script>
    $(function(){

        $('.header_right_click').mouseover(function(){
            $(this).find('.dropdown-menu').show();
            $(this).find('.dropdown-toggle').addClass('dropdown_hover');
        })
        $('.header_right_click').mouseleave(function(){
            $(this).find('.dropdown-menu').hide();
            $(this).find('.dropdown-toggle').removeClass('dropdown_hover');
        })
    })
</script>
        <php>if(!is_login()){</php>
            <include file="Public/quick_login"/>
        <php>}</php>
        <php>if(is_login()){</php>
<!--弹出悄悄话聊天框-->
<div id="chat_text" class="chat_text white-popup mfp-hide">
    <div>向 <span id="qq-nickname"></span> 发送悄悄话</div>
    <php>
        if(C('TALK_WORDS_COUNT')){
        $Talk_words_count=C('TALK_WORDS_COUNT');
        }else{
        $Talk_words_count=1000;
        }
    </php>

                            <span class="pull-right show_num_quick_qq"
                                  style="margin-right: 10px;">{$Talk_words_count}</span>

    <div class="talk_box">
        <div>
            <textarea class="col-xs-12 form-control" id="tt_content_qq" style="height: 100px;"
                      placeholder="说点什么吧，哪怕就一个逗号~" onfocus="startCheckNum_quick_qq($(this))"
                      onblur="endCheckNum_quick_qq()"></textarea>

            <div class="clearfix"></div>
            <div class="do_action" style="margin-top: 10px;">
                <a href="javascript:" onclick="insertTalkFace($(this))"><img
                        class="weibo_type_icon"
                        src="__STATIC__/image/bq.png"/></a>
                <a type="submit" class="btn btn-primary" id="submit-button"
                   onclick="appendMessage_qq()"
                   style="float: right;background-color: #f36119;border-color: #f36119;color: #fff!important;">确定发送</a>
            </div>
        </div>
        <div id="emot_content" class="emot_content"></div>
    </div>
</div>
<script>
    var this_uid = "{$uid}";
    function appendMessage_qq() {
        close_face();
        $.post(U('Usercenter/Message/postMessage'), {to_uid: this_uid, content: $('#tt_content_qq').val()}, function (msg) {
            if (msg.status) {
                $('#tt_content_qq').val('');
                $('.show_num_quick_qq').html(initTalkNum_qq);
                toast.success('悄悄话发送成功！');
                $('.mfp-close').click();
            } else {
                handleAjax(msg);
            }
        }, 'json');
    }

    $('#tt_content').keypress(function (e) {
        if (e.ctrlKey && e.which == 13 || e.which == 10) {
            appendMessage_qq();
        }
    });

    var ID_setInterval_qq;
    var initTalkNum_qq = "{:C('TALK_WORDS_COUNT')}" ? "{:C('TALK_WORDS_COUNT')}" : 1000;
    function checkNum_quick_qq(obj) {
        var value = obj.val();
        var value_length = value.length;
        var can_in_num = initTalkNum_qq - value_length;
        if (can_in_num < 0) {
            value = value.substr(0, initTalkNum_qq);
            obj.val(value);
            value_length = initTalkNum_qq;
        }
        var html = value_length + '/' + initTalkNum_qq;
        $('.show_num_quick_qq').html(html);
    }
    function startCheckNum_quick_qq(obj) {
        ID_setInterval_qq = setInterval(function () {
            checkNum_quick_qq(obj);
        }, 250);
    }
    function endCheckNum_quick_qq() {
        clearInterval(ID_setInterval_qq);
    }
</script>
<script>
    $(function(){
        bindQqOpenPopupLink();
    });
</script>
        <php>}</php>




<a id="goTopBtn" title="回到顶部"></a>

<a id="goBottonBtn" title="去底部"></a>